package com.fj.order.web.dto;

import lombok.Data;

/**
 * @author fj
 * @date 2024/3/12 16:01
 */
@Data
public class FjResponse<T> {

    FjResponse(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    private int code;
    private String message;
    private T data;

    public static <T> FjResponse<T> ok(T data){
        return new FjResponse<>(200, "OK", data);
    }

    public static <T> FjResponse<T> fail(String message){
        return new FjResponse<>(500, message, null);
    }
}
